/**
 * 
 */
package com.tkiicpp.tank.utils.dependence;

import java.awt.Color;
import java.awt.Graphics;
import java.io.IOException;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;


/**
 * @author <a href="mailto:tanktong@gmail.com">Tank.Tong</a>
 * @version 1.0 2010-08-30 18:01:05
 * @since 1.0
 */
public class DependenceDraw extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4662926529950012476L;

	public DependenceDraw() {
		super("Dependence show");
		this.setBounds(200, 150, 900, 500);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//		Graphics g = this.getGraphics();
//		g.setColor(Color.RED);
//		g.drawOval(310, 210, 50, 50);
		try {
			long start = System.currentTimeMillis();
			final DependenceTree tree = DependenceAnalyzer.analyzeAllPossibleDependence(
					"C:/work/workspace/Common_Dependence/workspace/commons/sg-commons-base.jar");
			start = System.currentTimeMillis() - start;
			System.out.println(start);
			
			this.add(new JPanel() {

				/**
				 * 
				 */
				private static final long serialVersionUID = -7262250704593420560L;

				@Override
				public void paint(Graphics g) {
					System.out.println(this.getWidth());
					System.out.println(this.getHeight());
					System.out.println(this.getAlignmentX());
					System.out.println(this.getAlignmentY());
					
					g.setColor(Color.RED);
					g.drawOval(10, 10, 50, 50);
				}
				
			});
			
			
		} catch (IOException e) {
			e.printStackTrace();
			this.add(new JLabel("IOException : "));
		}
		
		this.setVisible(true);
	}

//	@Override
//	public void paint(Graphics g) {
//		
//		
//	}
	
	public static void main(String[] args) {
		new DependenceDraw();
	}
}
